<?php
/*
  Document   : admin
  Created on : 12-mei-2011, 12:05:08
  Author     : Shahram abdi
  Description:
 */
?>
<div id="content">
    <?php
    require_once('../config/appvars.php');
    require_once('../config/config.php');

    // Make sure the user is logged in before going any further.
    if (!isset($_SESSION['user_id'])) {
        echo '<p class="login">Please <a href="../index.php?p=home">log in</a> to access this page.</p>';
        exit();
    }

    $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);

    $query = "SELECT instellingnaam, film FROM werkgeverprofiel";
    $data = mysqli_query($dbc, $query);

    echo '<h4>Bedrijfspresentatie:</h4>';
    
    while ($row = mysqli_fetch_array($data)) {
        if (!empty($row['film'])) {

            echo '<b>Werkgever:</b> ' . $row['instellingnaam'] . '<br/> ';
            echo '<div id="viewfilm"> <OBJECT ID="MediaPlayer" WIDTH="245" HEIGHT="200" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
            STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
            <PARAM NAME="FileName" VALUE="' . MM_UPLOADPATH . $row['film'] . '">
            <PARAM name="autostart" VALUE="false">
            <PARAM name="ShowControls" VALUE="true">
            <param name="ShowStatusBar" value="false">
            <PARAM name="ShowDisplay" VALUE="false">
            <EMBED TYPE="application/x-mplayer2" SRC="' . MM_UPLOADPATH . $row['film'] . '" NAME="MediaPlayer"
            WIDTH="290" HEIGHT="290" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED>
            </OBJECT></div>';
        }
    }
    mysqli_close($dbc);
    ?>
</div>
